﻿@*@model ScrumProject.Models.Project*@
@model ScrumProject.ViewModels.ProjectIndexData

@{
    ViewBag.Title = "Details";
}


<h2>@ViewBag.projectName</h2>

@*<table class="table">
<td>
    <tr>
        <th>Name</th>
        <th>Description</th>
    </tr>
    <tr>
        <td><center>@ViewBag.projectName</center></td>
        <td><center>@ViewBag.projectsDesc</center></td>
    </tr>
</table>*@




@if (Model.Stories != null)
{ 
    <h3>List of stories</h3>     
    <table class="table"> 
        <tr> 
            <th>Name</th> 
            <th>Description</th> 
            <th>Tests</th>
            <th>Priority</th>
            <th>Business value</th>
            <th>Notes</th>
            @*<th>Status</th>            
            <th>Points</th>*@
        </tr> 
 
        @foreach (var item in Model.Stories)
        {
            string selectedRow = "";
            if (item.Id == ViewBag.StoriesID)
            {
                selectedRow = "selectedrow";
            } 
            <tr class="@selectedRow"> 
                @*<td> 
                    @Html.ActionLink("Select", "Index", new { storiesID = item.Id }) 
                </td>*@ 
                <td><center>
                    @item.Name</center>
                </td> 
                <td> <center>
                    @item.Description </center>
                </td> 
                <td> <center>
                    @item.Tests</center>
                </td> 
                <td><center>
                    @item.Priority</center>
                </td>
                <td><center>
                    @item.BusinessValue</center>
                </td>
                <td><center>
                    @item.Notes</center>
                </td>
               @* <td><center>
                    @item.Status</center>
                </td>
                
                <td><center>
                    @item.Points</center>
                </td>*@
            </tr> 
        }

@*        <tr class="@selectedRow"> 
            @*<td> 
                @Html.ActionLink("Select", "Index", new { storiesID = item.Id }) 
            </td>
            <td> <center>
                @item.DateFrom</center>
            </td> 
            <td> <center>
                @item.DateTo</center>
            </td> 
            <td><center> 
                @item.Velocity</center>
            </td> 
            <td><center>
                @item.Status</center>
            </td>
        </tr> *@
    </table>
}
   
   @* @Html.ActionLink("Edit", "Edit", new { id=Model.Projects.First().Id }) |*@
 @if (ViewBag.manageStories){ 
        <center>@Html.ActionLink("Manage Stories", "Index", "Story", new { projectId = ViewBag.projectId }, null)</center> 
     }
     
     @if (Model.Sprints != null)
{ 
    <h3>Sprints</h3> 
    <table class="table"> 
        <tr>
            <th>Date From</th> 
            <th>Date To</th> 
            <th>Velocity</th>
            <th>Status</th>
        </tr> 
 
        @foreach (var item in Model.Sprints)
        {
            string selectedRow = "";
            if (item.Id == ViewBag.StoriesID)
            {
                selectedRow = "selectedrow";
            } 
        
            <tr class="@selectedRow"> 
                @*<td> 
                    @Html.ActionLink("Select", "Index", new { storiesID = item.Id }) 
                </td>*@ 
                <td> <center>
                    @item.DateFrom</center>
                </td> 
                <td> <center>
                    @item.DateTo</center>
                </td> 
                <td><center> 
                    @item.Velocity</center>
                </td> 
                <td><center>
                    @item.Status</center>
                </td>
            </tr> 
        } 
    </table>
    
    if (ViewBag.manageSprints)
    {
        <center>@Html.ActionLink("Manage Sprints", "Index", "Sprint", new { projectId = ViewBag.projectId }, null)</center>
    } 
}
     
<br/> 
<center>
    @Html.ActionLink("Back to Projects", "Index")
</center>

